<template>
   <aside>
      <div id="sidebar" class="nav-collapse ">
        <ul class="sidebar-menu" id="nav-accordion">
          <p class="centered"><img src="../assets/img/control.png" class="img-circle" width="80"></p>
          <li class="mt index">
            <a class="" id="index" @click="index($event)">
              <i class="fa fa-dashboard"></i>
                <span >{{mean_one}}</span>
            </a>
          </li>
          <li class="sub-menu ">
            <a id="collections" @click="collections($event)">
              <i class="fa fa-exchange"></i>
              <span>{{mean_tow}}</span>
            </a>
          </li>
          <li class="sub-menu">
            <a id="controlLog" @click="controlLog($event)">
              <i class="fa fa-desktop"></i>
              <span>{{mean_three}}</span>
            </a>
          </li>
           <li class="sub-menu">
            <a id="user" @click="user($event)">
              <i class="fa fa-cogs"></i>
              <span>{{mean_four}}</span>
            </a>
          </li>
        </ul>
      </div>
    </aside>
</template>

<script>
  export default {
    name: 'mymenu',
    data () {
      return {
        mean_one:'学校主页',
        mean_tow:'采集器',
        mean_three:'控制日志',
        mean_four:'用户管理',
      }
    },
    methods:{
      index:function($event){
        // $("#nav-accordion .mt a").removeClass("active")
        // $event.currentTarget.className='active'
        this.$router.push({path: '/index'})
      },
      controlLog:function($event){
        // $("#nav-accordion .sub-menu a").removeClass("active")
        // $event.currentTarget.className='active'
        this.$router.push({path: '/controlLog'})
      },
      collections:function($event){
        // $("#nav-accordion li a").removeClass("active")
        // $event.currentTarget.className='active'
        this.$router.push({path: '/collections'})
      },
      user:function($event){
        this.$router.push({path: '/user'})
      },
      setMenu(msg){
        if(msg == 'index' || msg == 'fan'){
          $("#index").addClass("active")
        }else if(msg == 'controlLog'){
          $("#controlLog").addClass("active")
        }else if(msg == 'collections'){
          $("#collections").addClass("active")
        }else if(msg == 'user'){
          $("#user").addClass("active")
        }
      }
    }
  }
</script>

<style scoped>
  @import "../assets/css/jquery.gritter.css";
  span{
    cursor:pointer;
  }
</style>
